package com.shudes.game;

import java.util.*;

public class Board extends CardCollection {
	
	public Board() {
		super(5);
	}
	
	public Board(Collection<Card> c) {
		this(); 
		if(c==null) { 
			throw new NullPointerException("board cannot be null."); 
		} else if(c.size()>5) { 
			throw new RuntimeException("cannot create a board with " + c.size() + " cards.");
		}
		
		for(Card j : c ) { 
			this.add(j); 
		}
	}
			
	public ArrayList<Card> flop() { 
		return slice(0,1,2); 
	}
	
	public Card turn() { 
		return (count()<4) ? null : get(3); 
	}
	
	public Card river() {
		return (count()<5) ? null : get(4); 
	}

}
